package com.beiyan.mvc.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
public class TestController {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = LogManager.getLogger(TestController.class.getName());

	@RequestMapping(value = "/hello", method = RequestMethod.GET)
	public @ResponseBody String hello() {
		logger.debug("hello() - start"); //$NON-NLS-1$

		logger.debug("hello() - end"); //$NON-NLS-1$
		return "Hello";
	}

	@RequestMapping(value = "/session", method = RequestMethod.GET)
	public String sessionView(HttpServletRequest req, HttpServletResponse res) {
		return "test/session";
	}

}
